package homework19;

import java.util.Scanner;

public class Gameing {
    public static void main(String[] args) {
        Game game = new Game();
        while (true) {
            System.out.println("请输入操作");
            System.out.print("若为1,则添加物品   ");
            System.out.print("若为2,,则修改物品   ");
            System.out.print("若为3,则删除物品   ");
            System.out.println("若为5,则查询所有物品   ");
            Scanner scanner = new Scanner(System.in);
            int a = scanner.nextInt();
            if (a == 1) {
                System.out.println("请选择添加的物品名称");
                String b = scanner.next();
                game.addGoods(b);
            }
            if (a == 2) {
                System.out.println("请选择第几个物品");
                int a1 = scanner.nextInt();
                System.out.println("请输入被修改的物品名称");
                String b = scanner.next();
                game.updateGoods(a1, b);
            }
            if (a == 3) {
                System.out.println("请选择删除第几个物品");
                int a1 = scanner.nextInt();
                game.deleteGoods(a1);
            }

            if (a == 5) {
                game.findGoodsS();
            }

        }

    }
}
